<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>用户列表</title>
</head>
<style>
    .even{
        background-color: gold;
    }
    .ood{
        background-color: pink;
    }

    .my-border{
        border: 1px solid darkred
    }
</style>
<body>
    <div th:each=" user : ${userList} " class="my-border"
         th:classappend="${userStat.even ? 'even' : 'ood' }">
        <div th:if="${userStat.count < 3}">---------分割线---------</div>
        <div th:text="'ID' + ${user.userId}"></div>
        <div th:text="'用户名' + ${user.username}"></div>
        <div th:text="'昵称' + ${user.nickname}"></div>
        <div th:text="'是否是偶数' + ${userStat.even}"></div>
        <div th:text="'昵称2' + ${userStat.current.nickname}"></div>
        <div th:text="'时间' + ${user.testTime}"></div>
        <div th:text="'格式化时间' + ${#dates.format(user.testTime, 'yyyy-MM-dd')}"></div>

        <div th:if="${userStat.even || userStat.count == 3}">
            或运算
        </div>
    </div>
</body>
<script>
    var userList = [[${userList}]];
    console.log(userList);
</script>
</html>